#ifndef _OutputFileWriter_Digi_
#define _OutputFileWriter_Digi_

#include "TFile.h"
#include "TGraph.h"
#include "TCanvas.h"
#include "yaml.h"
#include <string>

#define MAXPMT 20

class OutputFileWriter
{
public:
    OutputFileWriter(YAML::Node);
    ~OutputFileWriter();

    void SaveAll();
    void WriteEvent(aSimEvent&);

private:
    TFile* m_OutFile;
    TTree* m_OutTree;
    Int_t m_NumOfPMT;

    bool m_DrawWhileDigi;
    TCanvas* m_Can;
    std::string m_DrawPath;
    Int_t m_NumOfPlots;
    Int_t m_iPlot;

    Int_t    m_PGTypeFlag;
    Double_t m_TruthEnergy;
    Double_t m_TruthPos[3];
    Double_t m_TruthMomDir[3];
    Double_t m_VSumQ[MAXPMT];
    TGraph* m_VPMTLineShape[MAXPMT];
    //std::vector<Double_t> m_VSumQ;
    //std::vector<TGraph*> m_VPMTLineShape;
};

#endif